Skip to content

feat(boxel-cli): Add publish/unpublish#4851

Open
backspace wants to merge 19 commits into
mainfrom
cs-11161-extract-workspace-sync-action
Open

feat(boxel-cli): Add publish/unpublish#4851
backspace wants to merge 19 commits into
mainfrom
cs-11161-extract-workspace-sync-action

Conversation

@backspace
Copy link
Copy Markdown
Contributor

@backspace backspace commented May 15, 2026

This adds boxel realm publish and unpublish, which followup work in #4897 will need.

Assuming you’ve created a profile already, exercise with something like this:

cd packages/boxel-cli
pnpm build
./dist/index.js realm publish https://realms-staging.stack.cards/buck/wittering-dragon-6/ https://buck.staging.boxel.dev/wittering-dragon-6/
./dist/index.js realm unpublish https://buck.staging.boxel.dev/wittering-dragon-6/

backspace and others added 5 commits May 15, 2026 14:57
The boxel-cli integration test suite covers the publish/unpublish and
readiness-check HTTP contract the realm-server exposes. CS-11161 was the
result of a realm-server-only PR changing /_publish-realm from a
synchronous 200 to an async 202 + poll model without anything tripping in
that PR's CI — boxel-cli-test only ran when packages/boxel-cli/** files
changed. Widening the trigger to also include realm-server changes makes
that class of drift fail pre-merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

Host Test Results

    1 files      1 suites   1h 31m 19s ⏱️
2 711 tests 2 696 ✅ 15 💤 0 ❌
2 730 runs  2 715 ✅ 15 💤 0 ❌

Results for commit b544ca6.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   7m 54s ⏱️ -35s
1 450 tests ±0  1 450 ✅ +1  0 💤 ±0  0 ❌  - 1 
1 541 runs  ±0  1 541 ✅ +1  0 💤 ±0  0 ❌  - 1 

Results for commit 62b11f4. ± Comparison against earlier commit b544ca6.

@backspace backspace marked this pull request as ready for review May 15, 2026 22:54
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43a358d0ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/boxel-cli/src/commands/realm/publish.ts Outdated
Comment thread .github/actions/publish-preview-realm/action.yml Outdated
backspace and others added 6 commits May 15, 2026 18:04
Commander exposes negated options (`--no-foo`) on the positive key
(`foo`) defaulting to `true`. The CLI shim for `boxel realm publish`
was reading `opts.noWait` / `opts.noRepublish`, which Commander never
sets — so `--no-wait` and `--no-republish` were silently ignored.
The programmatic `publishRealm(...)` API was unaffected, which is why
the integration tests still passed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extracts `publishCliOptsToOptions` so the Commander-flag → PublishOptions
translation is testable without a realm-server. The new tests would have
caught the CS-11161 bug class: they assert (a) Commander populates the
positive `wait` / `republish` keys for negated flags (not `noWait` /
`noRepublish`), and (b) the translation lowers `--no-wait` to
`waitForReady: false` and `--no-republish` to `republish: false`.

The integration tests exercise the programmatic publishRealm() API only
and missed both halves.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The realm-server-url input description claimed defaults were inferred
for stack.cards / boxel.ai / localhost, but this action's own inference
block only knows the two CI environments and hard-fails otherwise.
Localhost works fine in workspace-sync and unpublish-preview-realm
because they forward to _setup-boxel-cli without inferring a URL
themselves, but here the action needs the URL to compose the source-
realm URL. Documenting the actual contract rather than expanding the
inference, since no CI workflow invokes this against a localhost
matrix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the boxel-cli-test stack setup (build host/icons/ui via the
reusable test-web-assets workflow, start matrix, register realm users,
boot the dev services) and then invokes publish-preview-realm,
workspace-sync, and unpublish-preview-realm against the local stack —
referencing each action at @\${{ github.sha }} the same way a real
consumer would. Delete this workflow once a successful run is captured.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GitHub Actions doesn't allow expressions in a workflow step's `uses:`
ref — only literal strings. The `github.action_ref` expression that
works in the actions' own internal `uses:` clauses is evaluated by a
different parser context (composite-action steps) and isn't usable
here. The demo workflow only runs on this branch anyway, so pinning to
the branch name resolves to the latest pushed tip at run time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@backspace backspace changed the title Add CLI publish/unpublish and Actions to use them feat(boxel-cli) Add publish/unpublish and Actions to use them May 19, 2026
@backspace backspace changed the title feat(boxel-cli) Add publish/unpublish and Actions to use them feat(boxel-cli): Add publish/unpublish and Actions to use them May 19, 2026
backspace and others added 7 commits May 19, 2026 07:33
GitHub Actions' workflow parser rejects expressions in a composite
action's `uses:` ref (the same restriction that hit the demo workflow,
just at a different parser layer). That meant the three top-level
actions could not call `_setup-boxel-cli@\${{ github.action_ref }}`
and have it run at the ref the consumer pinned.

Inlining the setup scaffolding (clone boxel, install pnpm, build the
CLI, configure the profile) into each action removes the cross-action
`uses:` and makes them parseable. The cost is ~50 lines of duplication
across three files; the comment block at the top of `runs:` calls that
out so future edits stay in sync.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The realm-server and vite host both speak HTTPS+HTTP/2 only (the
prerenderer needs HTTP/2 multiplexing, see infra:ensure-dev-cert). The
previous demo workflow's http:// probe and http:// action inputs would
never match the running services — the readiness loop spun for 10
minutes and timed out. Update the probe to mirror boxel-cli-test
(curl -sk + %{http_code} check) and pass https://localhost:4201/ to the
action inputs.

Matrix stays on http://localhost:8008 — synapse doesn't terminate TLS
locally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous setup wrote BOXEL_SRC/packages/boxel-cli/bin to
$GITHUB_PATH, but that directory holds the script named `boxel.js`
(the file package.json's `bin: { boxel }` maps to). Even when
$GITHUB_PATH did propagate, the next step would fail to find a
`boxel` binary. Symlinking the entry point into /usr/local/bin —
which is already on the default PATH — gives subsequent steps the
same `boxel` command that npm/pnpm-installed callers see.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pnpm register-realm-users runs in realms-only mode and only registers
the REALM_USERS list — it skips EXTRA_USERS, which is where the
user/password account this demo authenticates as lives. Switch to
register-all so synapse has that account when boxel realm create
attempts a Matrix login (boxel-cli #4851 run failed with 403 because
the account never existed in synapse).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
register-all writes EXTRA_USERS into the boxel users table via
ensureUserRecord, so it requires postgres up — register-realm-users
(realms-only) doesn't. Add an explicit start:pg + wait-for-pg step
pair before the matrix-user registration, mirroring the order the
ci.yaml matrix-test job uses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
register-all's ensureUserRecord step writes to the boxel users table,
but the boxel database is only created by the realm-server's
migrations on first boot. Without those migrations, register-all hits
'database "boxel" does not exist'. Run `pnpm migrate` (realm-server's
PgAdapter-driven migrator) between the wait-for-pg step and the
matrix-user registration to make the target schema exist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The publish-preview-realm / unpublish-preview-realm / workspace-sync
composite actions and their TEMPORARY demo workflow have been split
off into their own PR + Linear ticket (CS-11180) so this PR can land
on the small CLI half without waiting on the ~30-min action demo
each iteration. The action files are preserved on the new branch
cs-11180-extract-shared-preview-realm-github-actions-to-monorepo,
which keeps the CLI commits in its ancestry so the demo can still
exercise the CLI from this PR while it's in review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
backspace added a commit that referenced this pull request May 20, 2026
Extract the publish-preview-realm / unpublish-preview-realm /
workspace-sync composite actions so `boxel-catalog`, `boxel-home`,
`boxel-skills` (and any future consumer) can stop maintaining
duplicated bespoke preview-realm workflows.

The actions wrap the `boxel realm publish` / `unpublish` / `push`
CLI commands added in #4851 (CS-11161). They are extracted into
their own PR per CS-11180 so the slow action-demo workflow doesn't
gate review of the CLI half.

The bundled `cs-11180-action-demo.yml` workflow exercises all three
actions end-to-end against the same local matrix + realm-server
stack `boxel-cli-test` boots. It will fail until #4851 lands on
main (the actions `git clone` cardstack/boxel at
`github.action_ref`; without the CLI commands present at that ref,
`boxel realm publish` doesn't exist). That's the intended ordering.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@backspace backspace changed the title feat(boxel-cli): Add publish/unpublish and Actions to use them feat(boxel-cli): Add publish/unpublish May 20, 2026
@backspace backspace requested a review from a team May 20, 2026 00:26
backspace added a commit that referenced this pull request May 20, 2026
Extract the publish-preview-realm / unpublish-preview-realm /
workspace-sync composite actions so `boxel-catalog`, `boxel-home`,
`boxel-skills` (and any future consumer) can stop maintaining
duplicated bespoke preview-realm workflows.

This branch is layered on top of cs-11161 (#4851) so the bundled
demo workflow can exercise `boxel realm publish` / `unpublish` /
`push` end-to-end against the CLI commits in this branch's
ancestry. Once #4851 lands, GitHub will auto-rebase this PR's base
onto main and the diff will stay clean against main.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants